package com.duke.payphone.buy;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;
import com.duke.payphone.R;


/**
 * activity displays that the transaction has been complete,
 * and the transaction information (pulls from the globalvars where it was
 * stored by BuyInfo)
 * 
 * Buttons: Okay (back to ROOT)
 * 
 * @author Michael
 * 
 */
public class BuyCompleteActivity extends Activity {

    private TextView productname;
    private TextView date;
    private TextView price;
    private TextView seller;
    private TextView buyer;

    @Override
    public void onCreate (Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_buy_complete);

        productname = (TextView) findViewById(R.id.tv_productname);
        date = (TextView) findViewById(R.id.tv_date);
        price = (TextView) findViewById(R.id.tv_price);
        seller = (TextView) findViewById(R.id.tv_seller);
        buyer = (TextView) findViewById(R.id.tv_buyer);

        Intent i = getIntent();
        productname.setText(i.getExtras().getString("productname"));
        date.setText(i.getExtras().getString("date"));
        price.setText(i.getExtras().getString("price"));
        seller.setText(i.getExtras().getString("seller"));
        buyer.setText(i.getExtras().getString("buyer"));
    }

    @Override
    public boolean onCreateOptionsMenu (Menu menu) {
        // getMenuInflater().inflate(R.menu.activity_buy_complete, menu);
        // return true;
        return false;
    }

    public void executeDone (View v) {
        finish();
    }

}
